home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / winter_challenge.swf / scripts / DefineSprite_225 / frame_1 / PlaceObject2_224_1 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Text File  |  2011-08-19  |  2KB  |  62 lines

  1. onClipEvent(load){
  2.    function doHoppel()
  3.    {
  4.       frameCounter_1++;
  5.       frameCounter_2++;
  6.       if(frameCounter_1 <= frame_1_duration)
  7.       {
  8.          this.gotoAndStop(2);
  9.       }
  10.       if(frameCounter_1 > frame_1_duration && frameCounter_2 <= frame_2_duration)
  11.       {
  12.          newPos_y = rabbitSpeed * Math.sin(radian);
  13.          newPos_x = rabbitSpeed * Math.cos(radian);
  14.          prePos_x = _parent._x + newPos_x;
  15.          prePos_y = _parent._y + newPos_y;
  16.          if(_root.track_1.hitTest(prePos_x,prePos_y,true))
  17.          {
  18.             newPos_x = 0;
  19.             newPos_y = 0;
  20.          }
  21.          else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
  22.          {
  23.             newPos_x = 0;
  24.             newPos_y = 0;
  25.          }
  26.          else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
  27.          {
  28.             newPos_x = 0;
  29.             newPos_y = 0;
  30.          }
  31.          else if(_root.track_1.hitTest(prePos_x,prePos_y,true))
  32.          {
  33.             newPos_x = 0;
  34.             newPos_y = 0;
  35.          }
  36.          else
  37.          {
  38.             this.gotoAndStop(3);
  39.          }
  40.          _parent._x += newPos_x;
  41.          _parent._y += newPos_y;
  42.       }
  43.       if(frameCounter_1 > frame_1_duration && frameCounter_2 > frame_2_duration)
  44.       {
  45.          this.gotoAndStop(1);
  46.          frameCounter_1 = 0;
  47.          frameCounter_2 = 0;
  48.          doHoppel_flag = 0;
  49.       }
  50.    }
  51.    frameCounter_1 = 0;
  52.    frameCounter_2 = 0;
  53.    frame_1_duration = 2;
  54.    frame_2_duration = 4;
  55.    newPos_x = _parent._x;
  56.    newPos_y = _parent._y;
  57.    rabbitSpeed = 3 + random(10);
  58.    PI = 3.141592653589793;
  59.    doHoppel_flag = 0;
  60.    gothit_flag = 0;
  61. }
  62.